[IA64] Return ENOMEM if VPD allocation failed
authorAlex Williamson <alex.williamson@hp.com>
Fri, 11 May 2007 19:07:04 +0000 (13:07 -0600)
committerAlex Williamson <alex.williamson@hp.com>
Fri, 11 May 2007 19:07:04 +0000 (13:07 -0600)
Usually ASSRET() is "(void)0".  Therefore if VPD allocation
fails with xenheap shortage or fragmentation, NULL pointer
access occurs in vmx_final_setup_guest().
This patch fixes it.

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
xen/arch/ia64/vmx/vmx_init.c

index 01c0e4a8a449244ee740c78d7d9e3c1ed7d0a98f..3d463191e679afa86d9454b5bab0b3f62e07a7e7 100644 (file)
@@ -299,6 +299,8 @@ vmx_final_setup_guest(struct vcpu *v)
 
        vpd = alloc_vpd();
        ASSERT(vpd);
+       if (!vpd)
+               return -ENOMEM;
 
        v->arch.privregs = (mapped_regs_t *)vpd;
        vcpu_share_privregs_with_guest(v);